import {defineStore} from "pinia";
import {ref} from 'vue'
//没有持久化store
export const userStore = defineStore('token', () => {
    const token = ref('')
    //登录设置token信息的方法
    function setToken(newToken){
        token.value = newToken
    }
    function removeToken(){
        token.value = ''
    }
    return { token, setToken,removeToken }
},{
    persist: true,
})